﻿#coding: utf-8

require 'dm-validations'
require 'json'

class Link
	include DataMapper::Resource

	belongs_to :source, 'Node', :key => true 
	belongs_to :target, 'Node', :key => true 

	def to_json(*a)
		{
			'source' => source_id.to_i,
			'target' => target_id.to_i
		}.to_json(*a)
	end
end
